//
//  IAPProduct.m
//  Hangman
//
//  Created by  Stefan Nestorov on 9/27/14.
//  Copyright (c) 2014 Ray Wenderlich. All rights reserved.
//

#import "IAPProduct.h"


@implementation IAPProduct

- (id)initWithProductIdentifier:(NSString *)productIdentifier
{
    
    if ((self = [super init])) {
        
        self.availableForPurchase = NO;
        self.productIdentifier = productIdentifier;
        self.skProduct = nil;
    }
    
    return self;
}


- (BOOL)allowedToPurchase
{
    
    if ( self.availableForPurchase == NO ) return NO;
    
    if ( self.purchaseInProgress == YES ) return NO;
    
    if (self.purchase) return NO;
    
    return YES;
    
}


@end
